home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5287 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.9 KB

  1. Path: peer-news.britain.eu.net!demon!xetius.demon.co.uk
  2. From: chris@xetius.demon.co.uk (Chris Hudson)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Graphics with Borland Turbo c++ 4.5?
  5. Date: Sat, 03 Feb 1996 00:18:51 GMT
  6. Message-ID: <823306694.29004@xetius.demon.co.uk>
  7. References: <31129FB3.2F0A@gatekeeper.vic.com>
  8. NNTP-Posting-Host: xetius.demon.co.uk
  9. X-NNTP-Posting-Host: xetius.demon.co.uk
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Jonathan Driscoll <jd@gatekeeper.vic.com> wrote:
  13.  
  14. >I've been learning c++ from a disk tutorial I got, and it worked 
  15. >well until I got to the graphics section.  Apparently, that whole 
  16. >section is rather worthless, for it assumes you're using dos.  When I 
  17.  
  18. >#include <graphics.h>
  19.  
  20. >the compler gives me the error that BGI doesn't work under windows.  I'm 
  21. >rather new to c++, but from what I understand, certain functions 
  22. >(specifically, graphics functions) aren't the same for all c++ 
  23. >compilers, and I have to use graphics functions specific to the Borland 
  24. >Turbo c++ compiler.  This brings up two problems.
  25. >    First, I got into c++ programming because it was supposed to be 
  26. >a new and emerging standard in programming languages.  But how standard 
  27. >can a language be if programs are specific to the brand of compiler 
  28. >used?  It's all rather disillusioning for a beginning progammer...
  29. >    Second, and more importantantly, I have no idea how to use the 
  30. >damn thing.  Although I commend Borland for their extensive use of 
  31. >online help, it's really no help at all.  I would really appreciate if 
  32. >someone would post a simple (really, really simple) program that does 
  33. >something like set the background color and draw a rectangle.
  34. >    Thanks for the help,
  35.  
  36. >        Jonathan Driscoll (jd@vic.com)
  37.  
  38. As windows is a graphical operating system it is bound to have a large
  39. number of specific functions for producing graphics, and also
  40. isolating these graphics from the user.  To produce graphics in DOS is
  41. quite simple (Using the BGI libraries), you simply initialise the
  42. graphics driver, and tell it what you want to do.  Within windows it
  43. is also relatively simple (Once you have everything setup within the
  44. Application), you simply write everything to the DC (Device context).
  45. But this in itself is an integral part of windows, so its best to
  46. learn windows programming using C++.
  47.  
  48. C++ Is highly standardised, but things like BGI libraries, simply by
  49. their name are not standardised (Borland Graphical Interface),  and
  50. some things like this will be different for each compiler.  As of yet,
  51. there is not a standardised set of libraries for windows programming,
  52. as you have Microsoft with their MFC libs, and Borland with their OWL
  53. libs, so noone has yet devised a standard set of libs, but its getting
  54. their (My money is on Microsoft).
  55.  
  56. Do the BGI libraries not work if you compile a DOS application, and
  57. run it under a DOS session in windows.  I used to do some work like
  58. this, and once you get used to it, it can be quite effective.
  59.  
  60. Hope this helps
  61.  
  62. Chris (chris@xetius.demon.co.uk)
  63.  
  64.